/**
     * 获得url参数
     * @param name
     * @returns {*}
     */

export function getQueryString (name) {
  var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)')
  var r = window.location.search.substr(1).match(reg)
  if (r != null) {
    return r[2]
  } else {
    if (!location.hash) return ''
    var regHash = new RegExp('(^|&|\\?)' + name + '=([^&]*)(&|$)')
    var rHash = location.hash.slice(1).match(regHash)
    return rHash != null ? rHash[2] : ''
  }
  // eslint-disable-next-line no-unreachable
  return ''
}
